package ooday04homework;

public class AnonInnerClassDemo {
    public static void main(String[] args) {
        //Inter inter = new Inter(); 报错接口不能实例化
        Inter inter = new Inter() {};
        Dog dog = new Dog(){
            void eat() {
                System.out.println("Dog吃：我是匿名内部类");
            }
        };
        Swim swim = new Swim() {
            public void swim() {
                System.out.println("Swim游泳：我是匿名内部类");
            }
        };
        InterInter interinter = new InterInter() {
            public void show() {
                System.out.println("show展示：我是匿名内部类");
            }
        };
        interinter.show();
        swim.swim();
        dog.lookHome();
    }
}
